﻿using first_space;
using second_space;
using MySql;
using MySql.Data.MySqlClient;

namespace first_space
{
    class namespace_cl
    {
        public void func()
        {
            Console.WriteLine("Inside first_space");
        }
    }
}
namespace second_space
{
    class namespace_cl
    {
        public void func()
        {
            Console.WriteLine("Inside second_space");
        }
    }
}


namespace cstudy
{



    abstract class Shape
    {
        abstract public int area();
    }

    class Fangkuai : Shape
    {
        public override int area()
        {
            throw new NotImplementedException();
        }
    }

    internal class Program
    {
       static int memberVar = 30; // 成员变量，在整个类中可见

        static void Main(string[] args)
        {
            Console.WriteLine("Hello, World!");
            int a = 110;
            int c = 10;
            Console.WriteLine(a+c);
            Console.WriteLine(memberVar);
            //冷处理



            //测试

            //Rectangle r = new Rectangle();
            //r.AcceptDetails();
            //r.Display();

            //Console.WriteLine(FindMax(111,20));
            //Console.ReadLine();

            for (int i = 5; i < 10; i++) {
                Console.WriteLine(i);
            }



            first_space.namespace_cl fc = new first_space.namespace_cl();
            second_space.namespace_cl sc = new second_space.namespace_cl();
            fc.func();
            sc.func();


            //简单查询
            SqlTest.simpleSelect();
            //






        }

        public static int FindMax(int num1, int num2)
        {
            /* 局部变量声明 */
            int result;

            if (num1 > num2)
                result = num1;
            else
                result = num2;

            return result;
        }


    }


    class Rectangle
    {
        // 私有成员变量
        private double length;
        private double width;

        // 公有方法，用于从用户输入获取矩形的长度和宽度
        public void AcceptDetails()
        {
            Console.WriteLine("请输入长度：");
            length = Convert.ToDouble(Console.ReadLine());
            Console.WriteLine("请输入宽度：");
            width = Convert.ToDouble(Console.ReadLine());
        }

        // 公有方法，用于计算矩形的面积
        public double GetArea()
        {
            return length * width;
        }

        // 公有方法，用于显示矩形的属性和面积
        public void Display()
        {
            Console.WriteLine("长度： {0}", length);
            Console.WriteLine("宽度： {0}", width);
            Console.WriteLine("面积： {0}", GetArea());
        }
    }//end class Rectangle  

    class SampleClass
    {
        public int x;
        public int y;
        public const int c1 = 5;
        public const int c2 = c1 + 5;

        public SampleClass(int p1, int p2)
        {
            x = p1;
            y = p2;
        }
    }


    class BaseClass { 
    
    }
    class DervideClsss : BaseClass, IBaseInterface
    {
        public void method()
        {
            throw new NotImplementedException();
        }
    }

    interface IBaseInterface {
        void method();
            
            }




}
